<include file="Public:header" />
	<div class="container">
		<div class="page-header">
			<h4>{:L('SYSTEM_SETTINGS')}</h4>
		</div>
		<include file="Public:alert" />		
		<div class="tabbable">
			<ul class="nav nav-tabs">
				<li><a href="{:U('setting/defaultInfo')}">{:L('SYSTEM_BASIC_SETTINGS')}</a></li>
				<li><a href="{:U('setting/smtp')}">{:L('SMTP_SETTINGS')}</a></li>
				<li class="active"><a href="{:U('setting/fields')}">{:L('CUSTOM_FIELD_SETTINGS')}</a></li>		
				<li><a href="{:U('navigation/setting')}">{:L('SYSTEM_MENU_SETTINGS')}</a></li>
				<li><a href="{:U('setting/weixin')}">{:L('MICRO_LETTER_PUBLIC_ACCOUNT_SETTINGS')}</a></li>
			</ul>
		</div>
		<div class="row">	
			<div class="span2 knowledgecate">
				<ul class="nav nav-list">
				<li class="active">
					<a href="javascript:void(0);" onclick="color_box()">{:L('CUSTOM_FIELD_SETTINGS')}</a>
				</li>
				<li><a <if condition="$_GET['model'] eq 'customer' || $_GET['model'] eq ''">class="active"</if> href="{:U('setting/fields', 'model=customer')}"><i class="icon-chevron-right"></i>{:L('CUSTOMER_FIELDS_SETTINGS')}</a></li>
				<li><a <if condition="$_GET['model'] eq 'business'">class="active"</if>  href="{:U('setting/fields', 'model=business')}"><i class="icon-chevron-right"></i>{:L('BUSINESS_FIELDS_SETTINGS')}</a></li>
				<li><a <if condition="$_GET['model'] eq 'product'">class="active"</if>  href="{:U('setting/fields', 'model=product')}"><i class="icon-chevron-right"></i>{:L('PRODUCT_FIELDS_SETTINGS')}</a></li>
				<li><a href="{:U('knowledge/category')}"><i class="icon-chevron-right"></i>{:L('KNOWLEDGE_CLASSIFICATION')}</a></li>
			</ul>
			</div>
			<form action="{:U('product/category_delete')}" method="post">
				<div class="span10">
					<p><div class="bulk-actions align-left">
						<input type="submit" class="btn" value="{:L('DELETE')}"/>
						<div class="pull-right">
							<a class="btn btn-primary" id="add_category">{:L('ADD_PRODUCT_CATEGORIES')}</a>
						</div>
					</div></p>
				</div>
				<div class="span10">
					<table class="table table-hover table-striped table_thead_fixed" width="95%" border="0" cellspacing="1" cellpadding="0">
						<thead>
							<tr>
								<th width="10%"><input type="checkbox" name="check_all" id="check_all" class="check_all"/> &nbsp;</th>
								<th width="10%">{:L('CLASSIFICATION_OF')}</th>
								<th width="10%">{:L('NUMBER_OF_PRODUCTS')}</th>
								<th width="20%">{:L('PRODUCT')}</th>
								<th width="25%">{:L('CLASSIFICATION_DESCRIPTION')}</th>
								<th width="20%">{:L('OPERATION')}</th>
							</tr>
						</thead>
						<tfoot>
							<tr>
								<td colspan="6">
									{$page}
								</td>
							</tr>
						</tfoot>
						<tbody>
							<volist name="category_list" id="vo">
								<tr>
									<td><input type="checkbox" class="list" name="category_list[]" value="{$vo.category_id}"/>
									</td>
									<td>{$vo.name}</td>
									<td>{$vo.count}</td>
									<td><volist name="vo.list" id="temp"><a href="{:U('product/view','id='.$temp['product_id'])}">{$temp.name}</a>、</volist></td>
									<td>
										{$vo.description}
									</td>
									<td><a class="edit" href="javascript:void(0)" rel="{$vo.category_id}">{:L('COMPILE')}</a>&nbsp;
									<a href="{:U('product/index','by=all&category_id='.$vo['category_id'])}">{:L('TO_VIEW_THE_PRODUCT')}</a></td>
								</tr>
							</volist>
						</tbody>
					</table>
				</div> <!-- End #main-content -->
			</form>
		</div>		
	</div>
	<div id="dialog-message1" class="hide" title="{:L('ADD_PRODUCT_CATEGORIES')}">loading...</div>
	<div id="dialog-message2" class="hide" title="{:L('EDIT_CATEGORY_INFORMATION')}">loading...</div>
<script type="text/javascript">
	function changeContent(){
		a = $("#select1  option:selected").val();
		if(a=='1'){
			window.location.href="{:U('product/index')}";
		}else if(a=='2'){
			window.location.href="{:U('product/category')}";
		}else if(a=='3'){
			window.location.href="{:U('product/count')}";
		}
	} 
	
	$('#dialog-message1').dialog({
		autoOpen: false,
		modal: true,
		width: 600,
		position :["center",100]
	});
	
	$('#dialog-message2').dialog({
		autoOpen: false,
		modal: true,
		width: 600,
		position :["center",100]
	});
	
	$(function(){
		$("#check_all").click(function(){
			$("input[class='list']").prop('checked', $(this).prop("checked"));
		});
		$("#add_category").click(function(){
			$('#dialog-message1').dialog('open');
			$('#dialog-message1').load("{:U('product/category_add')}");
		});
		$(".edit").click(function(){
			$('#dialog-message2').dialog('open');
			$id = $(this).attr('rel');
			$('#dialog-message2').load('{:U("product/category_edit","id=")}'+$id);
		});
	});
</script>
<include file="Public:footer" />	